package com.gitee.leijin.rbac.controller;


import cn.hutool.core.convert.Convert;
import com.gitee.leijin.rbac.entity.SysUser;
import com.gitee.leijin.rbac.service.SysUserService;
import com.gitee.leijin.rbac.util.Result;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Validated
@RequestMapping("/sys-user")
public class SysUserController {

    @Resource
    private SysUserService sysUserService;

    @GetMapping("/detail/{userId}")
    public Result<SysUser> getSysUserById(@PathVariable Integer userId) {
        return Result.success(sysUserService.getById(userId));
    }
}
